<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.2.min.js"></script> 
<script type="text/javascript" src="${ctx}/scripts/jcarousellite.min.js"></script> 
<script type="text/javascript" src="${ctx}/scripts/index.js"></script>
<title>北京车辆段</title>
<link href="${ctx}/css/index.css" rel="stylesheet" type="text/css" /> 
</head>
<script type="text/javascript">
var t = n = count = 0;
var iTimeoutId=""; 
var index=0; //默认第一个显示的图片的索引
var showTime=4000; //显示时间（单位：毫秒）
var img_VanishTime=500; //逐渐显示的时间（单位：毫秒）
$(function() {
    
    initData(); //初始菜单 标题 天气预报、安全天数等信息
    initXW();    //初始行文系统
    initSafHb();//左侧图标
    initNews();   //初始新闻
    initVedio();  //初始视频
    initPhoto();  //初始摄影
    
   
      
       
        $("#flash_bottom_right").find("div").each(function (i) {
            $(this).click(function () {
                $("#flash_bottom_right").find("div").each(function(i){
                    $("#flash_bottom_right").find("div").eq(index).removeClass("jiaodian");
                });
                $(this).addClass("jiaodian");
                $("#play").hide().attr({src:$("#ul1").find("img").eq(i).attr("src"),
                                        alt:$(this).find("img").eq(i).attr("alt")});
                $("#flash_top").find("a").eq(0).attr({href:$("#ul1").find("div").eq(i).find("a").eq(0).attr("href")});
                $("#play").fadeIn(img_VanishTime);
                index=i;
                window.clearInterval(iTimeoutId);
                iTimeoutId=window.setInterval(play,showTime);
            });
        });
        iTimeoutId=window.setInterval(play,showTime);
 
    
    //行文滚动
    var newsListTimer = null,
    newsList = $("#newsList").hover(function(){
        clearInterval(newsListTimer);
    }, function(){
        autoChgNews();
    }), _h = newsList.find("li").outerHeight(),
    newsListLength = newsList.find("li").length;

    function autoChgNews(){
        if(newsListLength <= 1){
            return ;
        }
        newsListTimer = setInterval(function(){
          newsList.find("li:first").animate({marginTop :  - _h}, function(){
          $(this).appendTo(newsList).css({"margin-top": 0})
            });
        }, 5000);
    }

    autoChgNews();
    
    
	 
     
    //滚动
    var ul = $("#lxfscroll ul");
	var li = $("#lxfscroll li");
	var tli = $("#lxfscroll-title li");	
	var speed = 350;
	var autospeed = 3000;	
	var i=1;
	var index = 0;
	var n = 0;
    /* 标题按钮事件 */
	function lxfscroll() {
				var index = tli.index($(this));					
				tli.removeClass("cur");
				$(this).addClass("cur");
				
				ul.css({"left":"0px"});	
				li.css({"left":"0px"}); 
				li.eq(index).css({"z-index":i});	
				li.eq(index).css({"left":"200px"});	
				ul.animate({left:"-200px"},speed); 	
				i++;	
			
    };
	/* 自动轮换 */
	function autoroll() {
					if(n >= 4) {
						n = 0;
					}
					tli.removeClass("cur");
				tli.eq(n).addClass("cur");
					ul.css({"left":"0px"});	
				li.css({"left":"0px"}); 
				li.eq(n).css({"z-index":i});	
				li.eq(n).css({"left":"200px"});	
				 	
					n++;
					i++;
					timer = setTimeout(autoroll, autospeed);
					ul.animate({left:"-200px"},speed);
				};
	/* 鼠标悬停即停止自动轮换 */
				function stoproll() {
					li.hover(function() {
						clearTimeout(timer);
						n = $(this).prevAll().length+1;
					}, function() {
						timer = setTimeout(autoroll, autospeed);
					});
					tli.hover(function() {
						clearTimeout(timer);
						n = $(this).prevAll().length+1;
					}, function() {
						timer = setTimeout(autoroll, autospeed);
					});
				};			
	tli.mouseenter(lxfscroll);
	autoroll();
	stoproll(); 
    
	var sWidth = $("#focus").width(); //获取焦点图的宽度（显示面积）
	var len = $("#focus ul li").length; //获取焦点图个数
	var index = 0;
	var picTimer;
	
	//以下代码添加数字按钮和按钮后的半透明长条
	var btn = "<div class='btnBg'></div><div class='btn'>";
	for(var i=0; i < len; i++) {
		btn += "<span></span>";
	}
	btn += "</div>" 
	$("#focus").append(btn);
	$("#focus .btnBg").css("opacity",0.5);
	
	//为数字按钮添加鼠标滑入事件，以显示相应的内容
	
	//本例为左右滚动，即所有li元素都是在同一排向左浮动，所以这里需要计算出外围ul元素的宽度
	$("#focus ul").css("width",sWidth * (len + 1));
	
	//鼠标滑入某li中的某div里，调整其同辈div元素的透明度，由于li的背景为黑色，所以会有变暗的效果
	
	
	//鼠标滑上焦点图时停止自动播放，滑出时开始自动播放
	$("#focus").hover(function() {
		clearInterval(picTimer);
	},function() {
		picTimer = setInterval(function() {
			if(index == len) { //如果索引值等于li元素个数，说明最后一张图播放完毕，接下来要显示第一张图，即调用showFirPic()，然后将索引值清零
				showFirPic();
				index = 0;
			} else { //如果索引值不等于li元素个数，按普通状态切换，调用showPics()
				showPics(index);
			}
			index++;
		},3000); //此3000代表自动播放的间隔，单位：毫秒
	}).trigger("mouseleave");
	
	//显示图片函数，根据接收的index值显示相应的内容
	function showPics(index) { //普通切换
		var nowLeft = -index*sWidth; //根据index值计算ul元素的left值
		$("#focus ul").stop(true,false).animate({"left":nowLeft},500); //通过animate()调整ul元素滚动到计算出的position
		$("#focus .btn span").removeClass("on").eq(index).addClass("on"); //为当前的按钮切换到选中的效果
	}
	
	function showFirPic() { //最后一张图自动切换到第一张图时专用
		$("#focus ul").append($("#focus ul li:first").clone());
		var nowLeft = -len*sWidth; //通过li元素个数计算ul元素的left值，也就是最后一个li元素的右边
		$("#focus ul").stop(true,false).animate({"left":nowLeft},500,function() {
			//通过callback，在动画结束后把ul元素重新定位到起点，然后删除最后一个复制过去的元素
			$("#focus ul").css("left","0");
			$("#focus ul li:last").remove();
		}); 
		$("#focus .btn span").removeClass("on").eq(0).addClass("on"); //为第一个按钮添加选中的效果
	}
	
    
    
	
});
</script>
<script type=text/javascript>
function menuFix() {
 var sfEls = document.getElementById("nav").getElementsByTagName("li");
 for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 
"");
  }
 }
}
window.onload=menuFix;
//--><!]]></script>
 
<script type="text/javascript">
        // flash
        var t = n = count = 0;
        $(function () {
            count = $("#flash_list > li").size();
        
            $("#flash_list li:not(:first-child)").hide();
             
            $("#flash_smallimg li").hover(function (event) {
                var i = parseInt($(this).attr("name"), 10) - 1;
                n = i;
                if (i >= count) return;
                $("#flash_list li").filter(":visible").hide().parent().children().eq(i).show();
                $("#flash_smallimg li").removeClass("current");
               
                $(this).addClass("current");
                 event.stopPropagation();
            }, function () {

            });
            t = setInterval("showAuto()", 3000);
            $("#flashBox").hover(function (event) {
                clearInterval(t);
            }, function (event) {
                clearInterval(t);
                t = setInterval("showAuto()", 3000);
            });

        })
        function showAuto() {
            n = n >= (count - 1) ? 0 : n + 1;
            $("#flash_smallimg > li:eq(" + n + ")").trigger('mouseover');
        }
 </script>
 

<body>
<div class="box">
	<div class="top">
    	<div class="Tright"><a href="#">收藏本页</a><span>|</span><a href="#">设为首页</a></div>
        您好，欢迎光临北京车辆段！
    </div> 
	 <div class="top_img">   	
		<div class="column">
         <div class="photo" id="photo">
          <ul class="clear" id="photo-sub" style="width:2944px;height:149px">
           <li><a href="#" title="图片说明一" target="_blank"><img src="${ctx}/images/web/top.jpg" /></a></li>
            <li><a href="#" title="图片说明二" target="_blank"><img src="${ctx}/images/web/top.jpg" /></a></li>
           <li><a href="#" title="图片说明三" target="_blank"><img src="${ctx}/images/web/top.jpg" /></a></li>
           <li><a href="#" title="图片说明四" target="_blank"><img src="${ctx}/images/web/top.jpg" /></a></li>
          </ul>
         </div>
        </div>	
    </div> 
<script type="text/javascript" src="${ctx}/scripts/lunbo.js"></script>
    <div class="logo_box">
    	<div class="logo"><a href="#"><img src="${ctx}/images/web/logo.jpg" /></a></div>
        <div id="logo_middle" class="logo_middle">
        	<dl>
            	<dd><a href="#">访谈</a><a href="#">博客</a></dd>
                <dd><a href="#">评论</a><a href="#">论坛</a></dd>
            </dl>
            
            <div class="clear"></div>
        </div>
        <div class="logo_tq">
        	 
            <div id="weather">
            	北京<br />晴转多云<br />-7~1微风
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
    <div class="nav_box">
    	<ul id="nav">
           <li><a href="">首页</a><ul><li><a href="">首页</a></li></ul></li><li><a href="">办公中心</a><ul><li><a href="">办公中心</a></li></ul></li><li><a href="">网络询呼</a><ul><li><a href="">网络询呼</a></li></ul></li><li><a href="">电子邮件</a><ul><li><a href="">电子邮件</a></li><li><a href="https://10.64.3.121/exchange">上级邮件</a></li><li><a href="http://10.78.103.132/email">段内邮件</a></li></ul></li><li><a href="">文件传递</a><ul><li><a href="">文件传递</a></li><li><a href="http://10.78.103.30">内部FTP</a></li><li><a href="http://10.78.103.30:85">外部FTP</a></li></ul></li><li><a href="">软件下载</a><ul><li><a href="">软件下载</a></li></ul></li>
			<li><a href="">干部考核通报</a>
			  <ul>
			    <li><a href="">干部考核通报</a>
			  </ul>
			</li>
			<li><a href="">管理登陆</a>
			  <ul>
			    <li><a href="">管理登陆</a>
			  </ul>
			</li>
		</ul>
    </div>
    <div class="login_box">
         
    	<div class="login">
        <form id="forms" action="${ctx}/web/Web/webLogin.do" method="post">
          <c:if test="${sessionScope.username==null||sessionScope.username==''}" >
            用户名：<input name="userName" type="text" class="shurubox" />
            密码：<input name="userPwd" type="password" class="shurubox" />
          <input type="button" onclick="login()" value="立即登录" class="liji" />
          </c:if>
           <c:if test="${sessionScope.username!=null&&sessionScope.username!=''}" >
                您好！${sessionScope.username}    <a href="${ctx}/web/Web/webLogout.do">退出 </a>
           </c:if>
          <c:if test="${requestScope.result!=null&&requestScope.result!=''}" >
			 <script type="text/javascript" >
			     alert('${requestScope.result}'); 
			 </script>
		 </c:if> 
          </form>
      
        </div>
        <div class="login_search">
        	<input type="text" value="请输入搜索关键字" class="search_box" /><input type="submit" class="search_but" value="" />
        </div>
        <div class="clear"></div>
    </div>
    <div class="content">
    	<div class="left">
        	<div class="left_nrbox">
            	<div class="left_nrbox_title">安全天数</div>
                <div class="left_nrbox_center">
					<div class="mbottom">
                    <span> <div id="safe1">安全生产</div> </span>
                    <table id="safe1Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;;font-size:18px;font-weight:bold;font-family:黑体"> 
                        
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="mbottom">
                    <span> <div id="safe2">安全生产</div> </span>
                    <table id="safe2Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;font-size:18px;font-weight:bold;font-family:黑体"> 
                      
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="mbottom">
                    <span > <div id="safe3">安全生产</div> </span>
                    <table id="safe3Table" width="93" border="0" style="background:url(${ctx}/images/web/time_bg.jpg) no-repeat; height:37px; text-align:center; float:left; vertical-align:middle;;font-size:18px;font-weight:bold;font-family:黑体"> 
                       
                    </table>
                    <span>天</span>
                    <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="left_nrbox" style="height:310px;" >
			    
            	<div class="left_nrbox_title"  >未签收通报</div> 
                <div class="left_nrbox_center"  id="newsList" >
                
                </div>
            </div>
             <div id="left_biaoti" class="left_biaoti">
            	 
            </div>
            <div class="left_grb"><a href="${ctx}/web/Web/getNewsByTitle.do?title=grb"><img src="${ctx}/images/web/grb.jpg" /></a></div>
            <div class="left_grb"><a href="${ctx}/web/Web/getNewsByTitle.do?title=lgt"><img src="${ctx}/images/web/jb.jpg" /></a></div>
            <div class="left_nrbox" style="border:1px solid #d5d5d5;">
            	<div class="left_nrbox_title">安全宣传</div>
               <div class="safety_img">
                	<div class="lxfscroll" id="lxfscroll" >
                	   <ul>
                       	<li><a href="${ctx}/web/Web/getNewsByTitle.do?title=safe"><img src="${ctx}/images/web/pic_2.jpg"  width="200" height="200" /></a></li> 
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=safe" ><img src="${ctx}/images/web/pic_1.jpg"  width="200" height="200" /></a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=safe"><img src="${ctx}/images/web/pic_2.jpg"  width="200" height="200" /></a></li> 
                      </ul>
                    
                    </div>
                </div>
            </div>
            <div class="left_nrbox" style="border:1px solid #d5d5d5;" >
            	<div class="left_nrbox_title">节能环保</div>
                <div class="safety_img">
                	<div class="wrapper">
                        <div id="focus">
	                        <ul>
                                <li>
                                    <div style="left:0; top:0; width:200px; height:200px;"><a href="${ctx}/web/Web/getNewsByTitle.do?title=hb" ><img src="${ctx}/images/web/pic_1.jpg" width="200" height="200" /></a></div>                
                                </li>
                                <li>
                                    <div style="left:0; top:0; width:200px; height:200px;"><a href="${ctx}/web/Web/getNewsByTitle.do?title=hb" ><img src="${ctx}/images/web/pic_1.jpg" width="200" height="200" /></a></div>
                                </li>
                            </ul> 
                        </div>
                    </div>
                </div>
			  </div>
            <div class="left_nrbox">
            	<div class="left_nrbox_title">友情链接</div>
            	
                <div class="safety_img link" style="heigth:70px" >
                    
                	<select >
                    	<option>请选择</option>
                    </select>
                    <select>
                    	<option>请选择</option>
                    </select>
                    <select>
                    	<option>请选择</option>
                    </select>
                    <input type="submit" value="" />
                </div>
            </div>
        </div>
        <div class="right">
        	<div class="right_topdiv">
            	<div class="right_topdiv_left" id="yaowen">
            	    <div  style="font-family:宋体;color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/titlebg2.jpg) no-repeat; height:36px; line-height:26px; font-size:16px;padding-top:1px;padding-left:26px;"  >要文</div>
            		<ul> 
            		   <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                    </ul>
                </div>
                <div class="right_lunbo">
                	<div class="flash">
                        <div class="flash_top"  >
                           
                        </div>
                        <div class="flash_bottom"> 
                            <div class="flash_bottom_right" id="yaowenNum">
                                  <div id="list_0" class="jiaodian">1</div>
                                <div id="list_1">2</div>
                                <div id="list_2">3</div>
                            </div>
                        </div>
                        <div id="imglistbox" class="ul1"> 
                     
                         </div>
            		</div>
                
                </div>
                <div class="clear"></div>
            </div>
            <div class="right_yunshubox">
            	<div class="right_yunshuboxL">
                	<div class="ys_title">
                    	<a href="#">更多>></a>段发邮件
                    </div>
                    <ul>
                    	<li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li> 
                    </ul>
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	<div class="ys_title">
                    	<a href="#">更多>></a>部门文件
                    </div>
                    <ul>
                    	<li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li> 
                        
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <div class="right_yunshubox">
            	<div class="right_yunshuboxL">
                	<div class="ys_title">
                    	<a href="#">更多>></a>情况通报
                    </div>
                    <ul>
                    	 
                    
                    </ul>
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	<div class="ys_title">
                    	<a href="#">更多>></a>会议纪要
                    </div>
                    <ul>
                    	<li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                         
                      
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <div id="title" class="right_xcimg" align="center" style="font-family:微软雅黑;font-size:36px;color:#FFFFFF;line-height:90px" ></div>
            <div id="newsContent">
           
            </div>
           
            <div class="right_topdiv" style="margin-top:15px;">
               <div  style="color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/titlebg2.jpg) no-repeat;width:700px;height:30px;line-height:26px;font-size:15px;padding-top:1px;padding-left:9px;">
                    	相关视频
               </div>
                
            	<div class="right_lunbo" style="margin-left:0px;line-height:30px;">
            	   <div id="sc_flashBox"  >
                    	<ul class="flash_list" id="flash_list">
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                           <li><a target="_blank" href="#"><img src="${ctx}/images/web/lunbo.jpg" /></a></li>
                       </ul>
                        <ul class="flash_smallimg" id="flash_smallimg">
                           <li id="p0" name="1" class="current">1</li>
                           <li id="p1" name="2">2</li>
                           <li id="p2" name="3">3</li>
                           
                           <li id="p3" name="4">4</li> 
                           <li id="p4" name="5">5</li> 
                           <li id="p5" name="6">6</li>
                          
                            
                        </ul>
                    </div>
                </div>
            	<div class="right_topdiv_left" style="padding-top:10px;">
                    <ul>
                    	<li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                        <li><a href="#">中宣部称道德堕落不是社会主义 中国道德尚在09:33</a></li>
                    </ul>
                </div> 
                <div class="clear"></div>
            </div> 
              
        
                  
            <div class="right_ztbox" >
            	    <div  style="color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/titlebg2.jpg) no-repeat;width:700px;margin-top:2px;height:26px;line-height:26px;font-size:15px;padding-top:1px;padding-left:9px;">
                    	相关专题
                </div> 
            	<div class="right_yunshuboxL">
                	 <ul>
                    	<li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj1">党建专题</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj2">党建专题</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=dj3">党建专题</a></li> 
                    </ul>
                </div>
                <div class="right_yunshuboxL" style="margin-left:10px;">
                	 <ul>
                    	<li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg1">政工专题</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg2">政工专题</a></li>
                        <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=zg3">政工专题</a></li> 
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            
        </div>
        <div class="clear"></div>
    </div>
    
  <div   style="color:#FFFFFF; font-weight:bold; background:url(${ctx}/images/web/sytitle.jpg) no-repeat; height:31px; line-height:31px; font-size:14px; padding-left:22px;" >
                    	摄影贴图
                 </div>
  <div class="login_scroll">
    <div class="scroll_big" style="display:block;">
         <span id="prev2"><img src="${ctx}/images/web/lunbo_L.jpg" /></span>
            <div id="box2" class="scroll_f">
                <ul>
                 <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
               <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
               <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
               <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
              <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
               <li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>
          
                </ul>
            </div>
        <span id="next2" style="margin-left:-5px;"><img src="${ctx}/images/web/lunbo_R.jpg" /></span>
    </div>
    </div>
    <div class="footer">Copyright ©20011-2012 北京车辆段 版权所有</div>
</div>
</body>
</html>
<script>
function initData(){
     $.get('${ctx}/news/Menu/topList.do?t='+Math.random(), function(josn) {
         	 if(josn!=""){
		     josn = josn.replace(new RegExp("null","gm"),'""');
		     var mydata = eval("("+josn+")");
			     if(mydata.weather!=''){
			       var ojb=mydata.weather; 
			       var temp=ojb.names.replace(new RegExp("#","gm"),'<br>'); 
			       
			       document.getElementById("weather").innerHTML='<img src="${ctx}'+ojb.urls+'" height="50px"/>'+'<div>'+temp+'</div>';
			        
			   }
			    if(mydata.title!=''){ 
			       var ojb=mydata.title;
			       document.getElementById("title").innerHTML='<b>'+ojb.names+'</b>';
			       
			   }
			    if(mydata.safe1!=''){
			       var ojb=mydata.safe1; 
			       document.getElementById("safe1").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){ 
			          var arr1 = ojb.createTimeString.split("-"); 
			           var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = (dif / (24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe1Table").append(content);
			       }
			       
			         
			   }
			   if(mydata.safe2!=''){
			       var ojb=mydata.safe2; 
			       document.getElementById("safe2").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){
			         var arr1 = ojb.createTimeString.split("-"); 
			         var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = (dif / (24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe2Table").append(content);
						
			       } 
			   }
			   if(mydata.safe3!=''){
			       var ojb=mydata.safe3; 
			       document.getElementById("safe3").innerHTML=ojb.names;
			       if(ojb.createTimeString!=''){
			          var arr1 = ojb.createTimeString.split("-"); 
			         var dt1 = new Date(); 
						dt1.setFullYear(arr1[0]); 
						dt1.setMonth(arr1[1] - 1); 
						dt1.setDate(arr1[2]); 
						var dt2 = new Date(); 
						var dif = dt2.getTime() - dt1.getTime(); 
						var days = (dif / (24 * 60 * 60 * 1000))+''; 
						 
						var content='';
						for(var i=0;i<days.length;i++){
						
						   content+='<td>'+days.charAt(i)+'</td>';
						}
						if(days.length<4){
						   for(var i=0;i<4-days.length;i++){
						     content='<td>0</td>'+content;
						   }
						}
						content='<tr>'+content+'</tr>';
						$("#safe3Table").append(content);
			       } 
			   }
			    if(mydata.menus!=''){
			      var ojb=mydata.menus;
			      var content='';
			      for(var i=0;i<ojb.length;i++){
			        content+='<li>';
			        content+='<a href="'+ojb[i].urls+'">'+ojb[i].names+'</a>';
			        content+='<ul>';
			         content+='<li><a href="'+ojb[i].urls+'">'+ojb[i].names+'</a></li>';
                    if(ojb[i].childrenMenu!=''){
                        var children=ojb[i].childrenMenu;
 						for(var j=0;j<children.length;j++){ 
							content+='<li><a href="'+children[j].urls+'">'+children[j].names+'</a></li>';
						 }
						
			         }
			         content+='</ul>';
			         content+='</li>';
			         
			      }
			      //alert(content);
			      document.getElementById("nav").innerHTML=content;
			   }
			    if(mydata.topTitle!=''){
			      var ojb=mydata.topTitle;
			      var content='<dl>';
			      for(var i=0;i<ojb.length;i++){
			        if(i>0&&i%2==0){
			            content+='</dl><dl>';
			        }
					content+='<dd><a href="'+ojb[i].urls+'">'+ojb[i].names+'</a> </dd>';
				  }
			      content+=' <div class="clear"></div>'; 
			      document.getElementById("logo_middle").innerHTML=content;
			      
			     
			   } 
			   if(mydata.leftTitle!=''){
			      var ojb=mydata.leftTitle;
			       var content=''; 
			      for(var i=0;i<ojb.length;i++){ 
					content+='<a href="'+ojb[i].urls+'"  >'+ojb[i].names+'</a>  ';
				  }
			      document.getElementById("left_biaoti").innerHTML=content;
			   }
			}
			  
        }) ;  
       
   }
   function initNews(){
       $.get('${ctx}/news/News/getNewsByTitleAjax.do?title=top&pNum=6&t='+Math.random(), function(josn) {
          josn = josn.replace(new RegExp("null","gm"),'""');
          var mydata = eval("("+josn+")"); 
          var content="";
          var numb=0;
          for(var p in mydata){  
             
	         var cat=mydata[p]; 
	         
	         if(p>0){
	             if(numb%2==0){
		             content+='<div class="right_yunshubox">';
		              content+='<div class="right_yunshuboxL">';
		         }else{
		             content+='<div class="right_yunshuboxL"  style="margin-left:10px;">';
		         }
		        
	             content+='<div class="right_huiyititle">';
	             content+='<a href="${ctx}/web/Web/listNews.do?categoryid='+cat.id+'"><img src="${ctx}/images/web/more.jpg" /></a>'+cat.names;
	             content+='</div>';
	             content+='<ul>';
	             var ojbs=cat.newsList;
				 for(var i=0;i<ojbs.length;i++){
				    var temp=ojbs[i];
				    if(i>=5){
	             	  break;
	             	}
	             	content+='<li><a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'">'+temp.title+'</a></li>';
	             	
	             }      
	             content+='</ul>';
	             content+='</div>';
	             if(numb%2==1){
		             content+='<div class="clear"></div></div>';
		         }
		         numb=numb+1;
		      }else{   // 首栏新闻 
		         var ojbs=cat.newsList;
		         var yaowen='<div  style="font-family:宋体;color:#d5262a;font-weight:bold;background:url(${ctx}/images/web/titlebg2.jpg) no-repeat; height:36px; line-height:26px; font-size:16px;padding-top:1px;padding-left:26px;"  >要文</div><ul>';
		         var yaowenNum=''; 
		         var imglistbox=''; 
				 for(var i=0;i<ojbs.length;i++){
				    var temp=ojbs[i];
	                yaowen+='<li><a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'">'+temp.title+'</a></li>';
	                var tempNum=i+1;
                    if(i==0){
                       
	                	yaowenNum+='<div id="list_'+i+'" class="jiaodian">'+tempNum+'</div>';
	                }else{
	                  	yaowenNum+='<div id="list_'+i+'" >'+tempNum+'</div>';
	                }
	                imglistbox+='<div><a href="${ctx}/web/Web/showNews.do?newsid='+temp.id+'"><img src="${ctx}/images/web/lunbo.jpg"/></a></div>';
	             } 
	             yaowen+='</ul>';
		      }
           }
           document.getElementById("newsContent").innerHTML=content;
           document.getElementById("yaowen").innerHTML=yaowen;
           document.getElementById("yaowenNum").innerHTML=yaowenNum;
           document.getElementById("imglistbox").innerHTML=imglistbox;
       });
   }
   function initXW(){ //初始化行文
       var content="<ul>";
       for(var i=0;i<11;i++){
            content+='<li style="background:url(${ctx}/images/web/left_dot.jpg) no-repeat left center;margin-bottom:10px;margin-left:14px;"><a style="font-size:12px; color:#8a2220;" href="#">行文'+i+'</a></li>';
        }
        content+="</ul>";              
   		 document.getElementById("newsList").innerHTML=content;
   }
  function initSafHb(){ //初始化左侧漫画
       $.get('${ctx}/news/News/getNewsByTitleAjax.do?title=safe&pNum=7&t='+Math.random(), function(josn) {
           var content="<ul>";
          if(josn!=""){
	          josn = josn.replace(new RegExp("null","gm"),'""');
	          var mydata = eval("("+josn+")"); 
	          for(var p in mydata){  
	             var cat=mydata[p];  
		         if(cat.caTypes=='IMG'){
			          var ojbs=cat.newsList;
					  for(var i=0;i<ojbs.length;i++){
					  	  var temp=ojbs[i];
						  if(i>=5){
				             	  break;
				           }
				          content+=' <li><a href="${ctx}/web/Web/getNewsByTitle.do?title=safe" ><img src="${ctx}/images/web/pic_1.jpg"  width="200" height="200" /></a></li>';
              
			          }   	
			        
		          }     
		       }
	        }
	        content+='</ul>';
           document.getElementById("lxfscroll").innerHTML=content;
        });       
   		$.get('${ctx}/news/News/getNewsByTitleAjax.do?title=hb&pNum=7&t='+Math.random(), function(josn) {
   		    var content="<ul>";
          if(josn!=""){
	          josn = josn.replace(new RegExp("null","gm"),'""');
	          var mydata = eval("("+josn+")"); 
	          for(var p in mydata){  
	             var cat=mydata[p];  
		         if(cat.caTypes=='IMG'){
			          var ojbs=cat.newsList;
					  for(var i=0;i<ojbs.length;i++){
					  	  var temp=ojbs[i];
						  if(i>=5){
				             	  break;
				           }
				           content+='<li>';
                           content+='<div style="left:0; top:0; width:200px; height:200px;"><a href="${ctx}/web/Web/getNewsByTitle.do?title=hb" ><img src="${ctx}/images/web/pic_1.jpg" width="200" height="200" /></a></div>';                
                           content+='</li>';
				       }   	 
		          }     
		       }
	        }
	        content+='</ul>';
           document.getElementById("focus").innerHTML=content;
        }); 
   }
   function initPhoto(){
      $.get('${ctx}/files/Files/listAjax.do?fileTypes=PHOTO&t='+Math.random(), function(josn) {
          var content="<ul>";
          if(josn!=""){
            var mydata = eval("("+josn+")");
             var ojbs=mydata.rows;
             
			 for(var i=0;i<ojbs.length;i++){
			   var temp=ojbs[i];
               content+='<li><a href="" title=""><img src="${ctx}'+temp.ctxpaths+temp.names+'"  width="146" height="111"/><span>'+temp.names+'</span></a></li>';
             
             }
          }
          if(content=="<ul>") {
             
             content+="<li></li>";
          }
          content+="</ul>";
          
         document.getElementById("box2").innerHTML=content;
         
         if(ojbs.length>5){
	         //图片滚动
	         $("#box2").jCarouselLite({
	                btnPrev: "#prev2",
	                btnNext: "#next2",
	                auto: 5000, //图片停留时间
	                scroll: 1, //每次滚动覆盖的图片个数
	                speed: 200, //设置速度，0是不动。其次就是数字越大 ，移动越慢。
	                vertical: false, //横向（true），竖向（false）
	                visible:5, //显示的数量
	                circular: true //是否循环
	         });
         }
     }) ;  
       
   }
    function initVedio(){
      $.get('${ctx}/files/Files/listAjax.do?fileTypes=VIDEO&t='+Math.random(), function(josn) {
          var content="<ul>";
          if(josn!=""){
            var mydata = eval("("+josn+")");
             var ojbs=mydata.rows;
			 for(var i=0;i<ojbs.length;i++){
               content+='<li><a href="" title=""><img src="${ctx}/images/web/llll.jpg"  width="146" height="111"/><span>未命名</span></a></li>';
            
            }
          }
          if(content=="<ul>") {
             content+="<li></li>";
          }
          content+="</ul>";
           
     }) ;  
       
   }
   function login(){  
        $('#forms').submit();
    }
 
    function play()
    {
        $("#play").fadeOut(img_VanishTime,function(){
            if(index!=$("#imglistbox div").length-1)
            {
                index++;
            }else
                index=0;
            if(index==0)
            {
                $("#flash_bottom_right").find("div").last().removeClass("jiaodian");
            }else
            {
                $("#flash_bottom_right").find("div").eq(index-1).removeClass("jiaodian");
            }
            $("#play").hide();
            $("#play").attr({src:$("#ul1").find("div").eq(index).find("img").attr("src"),
                            alt:$("#ul1").find("div").eq(index).find("img").attr("alt")});
            $("#flash_top").find("a").eq(0).attr({href:$("#ul1").find("div").eq(index).find("a").eq(0).attr("href")});
            $("#flash_bottom_right").find("div").eq(index).addClass("jiaodian");
            $("#play").fadeIn(img_VanishTime);
        });
    }     
</script>
